﻿namespace LxCFD
{
    public struct IndexRecorder
    {
        public int Start;
        public int End;
        public void GetSeg(out int start, out int endPlus1, int segIndex)
        {
            int nodeCount = GetCount();
            int taskCount = MultiThreads.GetThreadsCount();
            start = Start + nodeCount * segIndex / taskCount;
            endPlus1 = Start + nodeCount * (segIndex + 1) / taskCount;
        }
        public int GetCount()
        {
            return End - Start + 1;
        }
    }
}
